<template>


  <a-card :bordered="false">
    <div class="title">服务医生</div>
    <a-table
      style="margin-bottom: 24px"
      :columns="columns"
      :dataSource="doctor">

    </a-table>
  </a-card>



</template>

<script>
  import PageLayout from '@/components/page/PageLayout'
  import DetailList from '@/components/tools/DetailList'
  import ABadge from "ant-design-vue/es/badge/Badge"
  import { getAction } from '@api/manage'
  import DoctorAssistantRelationModal from './DoctorAssistantRelationModal'
  const DetailListItem = DetailList.Item

  export default {
    components: {
      PageLayout,
      ABadge,
      DetailList,
      DetailListItem,
      DoctorAssistantRelationModal
    },
    data () {
      return {
        title:'服务医生',
        modalMisible: false,
        id: ' ',
        columns: [
          {
            title: '编号',
            dataIndex: 'id',
            key: 'id'
          },
          {
            title: '服务医生姓名',
            dataIndex: 'name',
            key: 'name'
          },
          {
            title: '服务状态',
            dataIndex: 'status',
            key: 'status',
            customRender:function (res) {
              var status = "";
              if(res == 0){
                status = "无效";
              }else if(res == 1){
                status = "有效";
              }
              return status;
            }
          },
        ],
        doctor:{}
      }
    },
    filters: {
      statusFilter(status) {
        const statusMap = {
          'processing': '进行中',
          'success': '完成',
          'failed': '失败'
        }
        return statusMap[status]
      }
    },
    computed: {
      title () {
        return this.$route.meta.title
      }
    },
    created() {
      let id = this.$route.params.id;
      this.getDoctorList(id);
    },
    methods:{
      getDoctorList(id){
        let param = {};
        param.id = id;


        getAction(`/doctor/doctorAssistantRelation/doctorList`,param).then(res=>{
          this.doctor = res.result;
        })
      },





    }
  }
</script>

<style lang="less" scoped>
  .title {
    color: rgba(0,0,0,.85);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
  }
</style>